﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Joy.Erp.BasicArchives.Core.UniqueCodes
{
    public class UniqueCodeOptions
    {
        private readonly IDictionary<string, Type> _options;

        public UniqueCodeOptions()
        {
            _options = new Dictionary<string, Type>();
        }

        public Type GetOrNull(string key)
        {
            return _options.GetOrDefault(key);
        }

        public List<string> GetAllKeys()
        {
            return _options.Keys.ToList();
        }

        public void AddType(string key, Type segmentType)
        {
            _options.Add(segmentType.Name, segmentType);
        }
    }
}
